import axios from '@/libs/api.request'

export const getDeptList = ({name}) => {
  return axios.request({
    url: '/wh-portal/api/dept/deptList',
    data: {
      name: name,
    },
    method: 'post'
  })
};

export const getDeptTree = ({deptName}) => {
  return axios.request({
    url: '/wh-portal/api/dept/getDeptTreeList',
    method: 'post',
    params: {
      deptName
    }
  })
};

export const addDeptNode = (menuNode) => {
  return axios.request({
    url: '/wh-portal/api/dept/add',
    params: {
      menuNode
    },
    method: 'post'
  })
};


export const updateDeptNode = (menuNode) => {
  return axios.request({
    url: '/wh-portal/api/dept/updateNode',
    params: {
      menuNode
    },
    method: 'post'
  })
};

export const batchDeleteNodes = (ids) => {
  return axios.request({
    url: '/wh-portal/api/dept/delete',
    params: {
      ids
    },
    method: 'post'
  })
};
